Skip to content

Conversation

eljonny
Copy link
Owner

@eljonny eljonny commented Jun 3, 2025

This branch converts the dependency structure from static files to git submodules.

eljonny added 7 commits June 1, 2025 01:24
…to boost-1.88.0, then hook them up to the CMake build through Linking.cmake and the new Boost.Stacktrace.cmake... now just have to figure out the install for the TestCPP target.
I have forked the necessary repos into my own GH account, added the
 small required CMake modification to each project, verified build/
 test, and tagged each update appropriately, which is where the state
 of the repos here are now.
So in the future when Boost releases, this is the process:
 - Sync the boost dependency forks
 - Check out the new release tags
 - Apply the CMakeLists.txt changes from the previous
    *-cmake-git-submodule tags
 - Commit and retag with the appropriate release
 - Push the tag
 - Update TestCPP, create issue, PR, and link to milestone
 - Build/test/CI with the new tags
 - Fix any issues

At this point, the Boost.Stacktrace dependency and its transitives
 are set up as Git submodules and everything is working.
I think this is a much better way to manage the dependencies than
 manually merging everything from the new release in every time,
 and it tells the person which Boost.Stacktrace version the current
 version of the library depends on, and how that is connected to
 upstream.
It also helps to not be just using whatever the latest develop HEAD was
 at the time I updated it last.

Added a generic tag message for when a new Boost release is pulled in
 and retagged with the CMakeLists.txt changes.
Added new SubmodulesInit include to top-level CMakeLists.txt.
This ensures CMake updates all the dependencies that are git submodules
 so everything is at the right tag/commit and exists.
SubmodulesInit.cmake is fully implemented and derived from
https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html

No need to conditionally worry about including from Boost.Stacktrace
 since it is now handled through the git submodule dependencies.
Includes.cmake is altered to take this into account.

Add the required boost_* targets to the install target to ensure the
 necessary files are there to support the library when TestCPP gets
 installed.
These targets are identified and added to the list in
 Boost.Stacktrace.cmake.
Formatting.

Update the TestCPP package email contact to the appropriate HSF email
 address.

Implement a more selective and proper Boost.Stacktrace.cmake.
This version is easier to maintain if the Boost.Stacktrace dependencies
 change in the future.
It also lays out what targets to install given the environment we're
 building in.
Only run submodule init if the dependencies are actually used.

Link to the proper library targets for each scenario, and break down
 all the build scenarios so it's clear which scenario gets which
 Boost.Stacktrace implementation, or fall back on Boost::stacktrace
 in case it is unclear what is supported.
Formatting that makes it clear where the list items begin.

Ensure using Boost::stacktrace_basic if addr2line and backtrace are not
 found to enable at least limited backtracing.
Make sure the STREQUAL is wrapped, just to make it clear.

ClangCL requires notification through the BOOST_STACKTRACE_USE_WINDBG
 compile definition to ensure it uses WinDbg, ole32, and dbgeng.
And how using Boost.Stacktrace affects compatibility of the library w/
 C++11, since it requires C++14.

Fix casing.
@eljonny eljonny added this to the 0.8-release milestone Jun 3, 2025
@eljonny eljonny self-assigned this Jun 3, 2025
@eljonny eljonny added the enhancement New feature or request label Jun 3, 2025
Copy link

github-actions bot commented Jun 3, 2025

⚡ Static analysis result ⚡


🔴 clang-tidy found 180 issues! Click here to see details.

#include <iostream>
#include "internal/TestCPPExceptions.h"
#ifdef TESTCPP_STACKTRACE_ENABLED
#include <boost/stacktrace.hpp>

!Line: 28 - error: included header iostream is not used directly [misc-include-cleaner,-warnings-as-errors]

using std::string;
using std::runtime_error;
namespace TestCPP {
TestCPPException::TestCPPException (const char * msg) :

!Line: 37 - error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::runtime_error;
namespace TestCPP {
TestCPPException::TestCPPException (const char * msg) :
runtime_error(msg)

!Line: 38 - error: no header providing "std::runtime_error" is directly included [misc-include-cleaner,-warnings-as-errors]

TestCPPException(std::move(msg))
{
#ifdef TESTCPP_STACKTRACE_ENABLED
clog << boost::stacktrace::stacktrace();
#endif
}

!Line: 66 - error: std::move of the const variable 'msg' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 49 - note: consider changing the 1st parameter of 'TestCPPException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

TestCPPException(std::move(msg))
{
#ifdef TESTCPP_STACKTRACE_ENABLED
clog << boost::stacktrace::stacktrace();
#endif
}

!Line: 66 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

static constexpr const char * SP = " ";
static constexpr const char * START_RUN =
"Starting run of test ";
static constexpr const char * SUITE = "Suite ";
static constexpr const char * SUITE_TESTS_PASSED =
" suite tests passed!";

!Line: 88 - error: variable name 'SP' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

TestObjName (const char* name);
/**
* @brief Get the encapsulated name for the TestCPP object that
* holds this object.
* @return The name of the TestCPP object that this object

!Line: 73 - error: single-argument constructors must be marked explicit to avoid unintentional implicit conversions [hicpp-explicit-conversions,-warnings-as-errors]

const string& getName () const;
/**
* @brief Output the test object name to the specified stream.
* @param s The stream to output to.
* @param tcName The test object name object.

!Line: 81 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

friend std::ostream& operator<< (
std::ostream& s,
const TestObjName& tcName
);
private:

!Line: 89 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

std::ostream& s,
const TestObjName& tcName
);
private:
string testCaseName;

!Line: 90 - error: parameter name 's' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

template <class T> class no_destroy {
// Flawfinder: ignore
alignas(T) unsigned char data[sizeof(T)];
public:
template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }

!Line: 106 - error: constructor does not initialize these fields: data [cppcoreguidelines-pro-type-member-init,hicpp-member-init,-warnings-as-errors]

alignas(T) unsigned char data[sizeof(T)];
public:
template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }
};

!Line: 108 - error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors]

template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug

!Line: 110 - error: constructor does not initialize these fields: data [cppcoreguidelines-pro-type-member-init,hicpp-member-init,-warnings-as-errors]

template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug

!Line: 110 - error: constructors that are callable with a single argument must be marked explicit to avoid unintentional implicit conversions [hicpp-explicit-conversions,-warnings-as-errors]

template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug

!Line: 110 - error: parameter name 'ts' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug
* logging is enabled.

!Line: 111 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug
* logging is enabled.

!Line: 111 - error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors]

bool stringContains (const string& source,
const string& contains);
/**
* @brief Safely converts unsigned integer values to signed.
* @param toCast The unsigned value to convert.

!Line: 137 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

int unsignedToSigned(unsigned toCast);
}
}
#endif

!Line: 145 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

if (name) {
this->testCaseName = name;
}
else {
throw TestCPPException(TCPPStr::NVTN);
}

!Line: 51 - error: implicit conversion 'const char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

const string& TestObjName::getName () const {
return this->testCaseName;
}
std::ostream& operator<< (
std::ostream& s,

!Line: 59 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

std::ostream& operator<< (
std::ostream& s,
const TestObjName& tcName
)
{
s << tcName.getName();

!Line: 63 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

std::ostream& s,
const TestObjName& tcName
)
{
s << tcName.getName();
return s;

!Line: 64 - error: parameter name 's' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

clog << endl;
}
#endif
}
bool stringContains(const string& source,

!Line: 78 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

bool stringContains(const string& source,
const string& contains)
{
return source.find(contains) != string::npos;
}

!Line: 83 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

int unsignedToSigned(unsigned toCast) {
if (toCast <= INT_MAX) {
return static_cast<int>(toCast);
}
if (toCast >= static_cast<unsigned>(INT_MIN)) {

!Line: 89 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
/**

!Line: 84 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
/**
* @brief Check that something is not equivalent to something

!Line: 85 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
/**

!Line: 110 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
/**
* @brief Check that a pointer is null.

!Line: 111 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
/**

!Line: 131 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
/**
* @brief Check that a pointer is non-null.

!Line: 132 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
/**

!Line: 152 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
/**
* @brief Verify that a function throws something.

!Line: 153 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

static const string logTestFailure(
T1 expectationValue, T2 actual,
const string& assertionTypeMessage,
const string& failureMessage,
const bool logValues
)

!Line: 243 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

static const string logTestFailure(
T1 expectationValue, T2 actual,
const string& assertionTypeMessage,
const string& failureMessage,
const bool logValues
)

!Line: 243 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

err << assertionTypeMessage << endl;
err << failureMessage << endl;
if (logValues) {
err << "Expectation value: <" << expectationValue << ">"
<< endl;

!Line: 252 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

err << failureMessage << endl;
if (logValues) {
err << "Expectation value: <" << expectationValue << ">"
<< endl;
err << "Actual: <" << actual << ">" << endl;

!Line: 253 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

static const string checkEquals(
T1 expected, T2 actual,
const string& failureMessage
)
{
if (expected != actual) {

!Line: 265 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

static const string checkEquals(
T1 expected, T2 actual,
const string& failureMessage
)
{
if (expected != actual) {

!Line: 265 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

static const string checkNotEquals(
T1 shouldNotBe, T2 actual,
const string& failureMessage
)
{
if (shouldNotBe == actual) {

!Line: 282 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

static const string checkNotEquals(
T1 shouldNotBe, T2 actual,
const string& failureMessage
)
{
if (shouldNotBe == actual) {

!Line: 282 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

static const string checkNull(
T ptr,
const string& failureMessage
)
{
bool null = ptr == nullptr;

!Line: 299 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

static const string checkNull(
T ptr,
const string& failureMessage
)
{
bool null = ptr == nullptr;

!Line: 299 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

static const string checkNotNull(
T ptr,
const string& failureMessage
)
{
bool notNull = ptr != nullptr;

!Line: 318 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

static const string checkNotNull(
T ptr,
const string& failureMessage
)
{
bool notNull = ptr != nullptr;

!Line: 318 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

const string TestCPP::Assertions::checkEquals<const char*, const char*>(
const char* expected, const char* actual,
const string& failureMessage
);
template<>

!Line: 387 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

const string TestCPP::Assertions::checkNotEquals<const char*, const char*>(
const char* shouldNotBe, const char* actual,
const string& failureMessage
);
#endif

!Line: 393 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

using std::clog;
using std::current_exception;
using std::endl;
using std::exception;
using std::exception_ptr;
using std::function;

!Line: 30 - error: no header providing "std::clog" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::current_exception;
using std::endl;
using std::exception;
using std::exception_ptr;
using std::function;
using std::rethrow_exception;

!Line: 31 - error: no header providing "std::current_exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::exception;
using std::exception_ptr;
using std::function;
using std::rethrow_exception;
using std::string;
using std::stringstream;

!Line: 33 - error: no header providing "std::exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::exception_ptr;
using std::function;
using std::rethrow_exception;
using std::string;
using std::stringstream;

!Line: 34 - error: no header providing "std::__exception_ptr::exception_ptr" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::function;
using std::rethrow_exception;
using std::string;
using std::stringstream;
namespace TestCPP {

!Line: 35 - error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::rethrow_exception;
using std::string;
using std::stringstream;
namespace TestCPP {

!Line: 36 - error: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::string;
using std::stringstream;
namespace TestCPP {
template<>

!Line: 37 - error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::stringstream;
namespace TestCPP {
template<>
const string Assertions::checkEquals<const char*, const char*>(

!Line: 38 - error: no header providing "std::stringstream" is directly included [misc-include-cleaner,-warnings-as-errors]

const string Assertions::checkEquals<const char*, const char*>(
const char* expected, const char* actual,
const string& failureMessage
)
{
if (strcmp(expected, actual)) {

!Line: 43 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

const string Assertions::checkEquals<const char*, const char*>(
const char* expected, const char* actual,
const string& failureMessage
)
{
if (strcmp(expected, actual)) {

!Line: 43 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

if (strcmp(expected, actual)) {
return logTestFailure(
expected, actual,
equivalenceAssertionMessage,
failureMessage,
true

!Line: 48 - error: function 'strcmp' is called without explicitly comparing result [bugprone-suspicious-string-compare,-warnings-as-errors]

if (strcmp(expected, actual)) {
return logTestFailure(
expected, actual,
equivalenceAssertionMessage,
failureMessage,
true

!Line: 48 - error: no header providing "strcmp" is directly included [misc-include-cleaner,-warnings-as-errors]

if (strcmp(expected, actual)) {
return logTestFailure(
expected, actual,
equivalenceAssertionMessage,
failureMessage,
true

!Line: 48 - error: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

const string Assertions::checkNotEquals<const char*, const char*>(
const char* shouldNotBe, const char* actual,
const string& failureMessage
)
{
if (!strcmp(shouldNotBe, actual)) {

!Line: 60 - error: return type 'const string' (aka 'const basic_string<char>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type,-warnings-as-errors]

const string Assertions::checkNotEquals<const char*, const char*>(
const char* shouldNotBe, const char* actual,
const string& failureMessage
)
{
if (!strcmp(shouldNotBe, actual)) {

!Line: 60 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

if (!strcmp(shouldNotBe, actual)) {
return logTestFailure(
shouldNotBe, actual,
nonequivalenceAssertionMessage,
failureMessage,
true

!Line: 65 - error: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
template<>

!Line: 83 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
template<>

!Line: 83 - error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
template<>
void Assertions::assertNotEquals<const char*, const char*>(

!Line: 84 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

throw TestFailedException(std::move(err));
}
}
template<>
void Assertions::assertNotEquals<const char*, const char*>(

!Line: 84 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
void Assertions::assertThrows (

!Line: 96 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
void Assertions::assertThrows (

!Line: 96 - error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
void Assertions::assertThrows (
function<void()> shouldThrow,

!Line: 97 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

function<void()> shouldThrow,
const string& failureMessage
)
{
try {
shouldThrow();

!Line: 102 - error: the parameter 'shouldThrow' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]

exception_ptr eptr = current_exception();
if (eptr) {
try {
rethrow_exception(eptr);
}

!Line: 110 - error: variable 'eptr' of type 'exception_ptr' can be declared 'const' [misc-const-correctness,-warnings-as-errors]

<< endl;
}
}
else {
clog << "Something was thrown, not sure what." << endl
<< "This satisfies the assertion, so no failure is"

!Line: 119 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

clog << "Something was thrown, not sure what." << endl
<< "This satisfies the assertion, so no failure is"
<< " present. "
<< TestFailedException("Unknown thrown object").
what();
}

!Line: 123 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

throw TestFailedException(std::move(failureMessage));
}
void Assertions::assertNoThrows (
const function<void()>& shouldNotThrow,
const string& failureMessage

!Line: 133 - error: std::move of the const variable 'failureMessage' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

throw TestFailedException(std::move(failureMessage));
}
}
void Assertions::assertTrue (
bool condition,

!Line: 145 - error: std::move of the const variable 'failureMessage' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
}

!Line: 164 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
}

!Line: 164 - error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
}
void Assertions::assertFalse (

!Line: 165 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
}

!Line: 185 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

if (err.size()) {
throw TestFailedException(std::move(err));
}
}
}

!Line: 185 - error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors]

throw TestFailedException(std::move(err));
}
}
}
[[noreturn]] void Assertions::fail(string failureMessage) {

!Line: 186 - error: std::move of the const variable 'err' has no effect or make the variable non-const [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

!Line: 98 - note: consider changing the 1st parameter of 'TestFailedException' from 'const string &&' (aka 'const basic_string<char> &&') to 'const string &'

[[noreturn]] void Assertions::fail(string failureMessage) {
throw TestFailedException(std::move(failureMessage));
}
}

!Line: 191 - error: the parameter 'failureMessage' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]

throw TestFailedException(std::move(failureMessage));
}
}

!Line: 192 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

enum TestCaseOutCompareOptions {
CONTAINS,
EXACT
};
/**

!Line: 92 - error: enum 'TestCaseOutCompareOptions' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size,-warnings-as-errors]

TestCase (const TestCase& o);
/**
* @brief Construct a TestCase by moving all data from another
* TestCase.
* @param o Move everything from this TestCase into the new one.

!Line: 146 - error: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

TestCase (TestCase&& o) noexcept;
/**
* @brief Copy a TestCase into another TestCase.
* @param rhs The test case to copy from.
* @return A reference to the new TestCase copy.

!Line: 153 - error: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

TestCase& operator= (const TestCase& rhs);
/**
* @brief Move a TestCase into another TestCase.
* @param rhs Move everything from this TestCase into the new
* one.

!Line: 160 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

TestCase& operator= (TestCase&& rhs) noexcept;
/**
* @brief Destroy a TestCase object.
*/
~TestCase ();

!Line: 169 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

bool checkStdout (const string& against);
/**
* @brief Check the argument against what is captured from
* std::clog using the configured comparison mode.
* @param against The value to check the captured output against

!Line: 224 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

bool checkLog (const string& against);
/**
* @brief Check the argument against what is captured from
* stderr using the configured comparison mode.
* @param against The value to check the captured output against

!Line: 233 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

bool checkStderr (const string& against);
/**
* @brief Run the test case.
* @return True if the test ran successfully, false otherwise.
*/

!Line: 243 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

bool go ();
/**
* @brief Returns the duration of the last run in nanoseconds.
* @return The duration of the last run of this TestCase in
* nanoseconds.

!Line: 249 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

long long getLastRuntime () const;
private:
bool notifyTestPassed = false;
bool pass = false;
bool stdoutCaptured = false;

!Line: 256 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

bool checkOutput (const string& source, const string& against);
static atomic_int stdoutCaptureCasesConstructed;
static atomic_int logCaptureCasesConstructed;
static atomic_int stderrCaptureCasesConstructed;
static atomic_int stdoutCaptureCasesDestroyed;

!Line: 315 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

static nanoseconds duration (const F& func, Args&&... args)
{
auto start = system_clock::now();
func(forward<Args>(args)...);
return duration_cast<nanoseconds>(
system_clock::now() - start

!Line: 345 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

TestSuite (TestObjName&& newSuiteName,
typename enable_if<sizeof...(TestType) == 0>::type)
{
commonInit(std::forward<TestObjName>(newSuiteName));
}

!Line: 79 - error: constructor does not initialize these fields: firstRun, testSuitePassedMessage, lastRunSucceeded, lastRunSuccessCount, lastRunFailCount, totalRuntime [cppcoreguidelines-pro-type-member-init,hicpp-member-init,-warnings-as-errors]

TestSuite (TestObjName&& newSuiteName,
typename enable_if<sizeof...(TestType) == 0>::type)
{
commonInit(std::forward<TestObjName>(newSuiteName));
}

!Line: 79 - error: rvalue reference parameter 'newSuiteName' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]

typename enable_if<sizeof...(TestType) == 0>::type)
{
commonInit(std::forward<TestObjName>(newSuiteName));
}
/**

!Line: 80 - error: all parameters should be named in a function [hicpp-named-parameter,readability-named-parameter,-warnings-as-errors]

TestSuite (TestObjName&& newSuiteName, TestType ...tests)
{
commonInit(std::forward<TestObjName>(newSuiteName));
this->addTests(tests...);
}

!Line: 90 - error: constructor does not initialize these fields: firstRun, testSuitePassedMessage, lastRunSucceeded, lastRunSuccessCount, lastRunFailCount, totalRuntime [cppcoreguidelines-pro-type-member-init,hicpp-member-init,-warnings-as-errors]

TestSuite (TestObjName&& newSuiteName, TestType ...tests)
{
commonInit(std::forward<TestObjName>(newSuiteName));
this->addTests(tests...);
}

!Line: 90 - error: constructors that are callable with a single argument must be marked explicit to avoid unintentional implicit conversions [hicpp-explicit-conversions,-warnings-as-errors]

TestSuite (TestObjName&& newSuiteName, TestType ...tests)
{
commonInit(std::forward<TestObjName>(newSuiteName));
this->addTests(tests...);
}

!Line: 90 - error: rvalue reference parameter 'newSuiteName' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]

static inline addTests () { }
/**
* @brief Add one or more tests at once to the test suite.
* @param test The first test to add.
* @param tests The rest of the tests to add.

!Line: 112 - error: function 'addTests' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier,-warnings-as-errors]

static inline addTests () { }
/**
* @brief Add one or more tests at once to the test suite.
* @param test The first test to add.
* @param tests The rest of the tests to add.

!Line: 112 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

unsigned getLastRunFailCount () const;
/**
* @brief Retrieve the total number of tests in the suite that
* succeeded (passed) during the last suite run.
* @return The total number of tests that passed in the last

!Line: 148 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

unsigned getLastRunSuccessCount() const;
/**
* @brief Run all tests in the test suite.
*/
void run ();

!Line: 156 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

void commonInit(TestObjName&& newSuiteName) {
this->firstRun = true;
this->testSuitePassedMessage = true;
this->lastRunSucceeded = true;
this->lastRunFailCount = zeroInit;

!Line: 181 - error: rvalue reference parameter 'newSuiteName' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]

using std::cerr;
using std::clog;
using std::cout;
using std::endl;
using std::exception;
using std::fixed;

!Line: 36 - error: no header providing "std::cerr" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::clog;
using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::function;

!Line: 37 - error: no header providing "std::clog" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::function;
using std::invalid_argument;

!Line: 38 - error: no header providing "std::cout" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::function;
using std::invalid_argument;

!Line: 38 - error: using decl 'cout' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 38 - note: remove the using

using std::exception;
using std::fixed;
using std::function;
using std::invalid_argument;
using std::ostream;
using std::rethrow_exception;

!Line: 40 - error: no header providing "std::exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::fixed;
using std::function;
using std::invalid_argument;
using std::ostream;
using std::rethrow_exception;
using std::runtime_error;

!Line: 41 - error: no header providing "std::fixed" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::function;
using std::invalid_argument;
using std::ostream;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;

!Line: 42 - error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::invalid_argument;
using std::ostream;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;

!Line: 43 - error: no header providing "std::invalid_argument" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::invalid_argument;
using std::ostream;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;

!Line: 43 - error: using decl 'invalid_argument' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 43 - note: remove the using

using std::ostream;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 44 - error: no header providing "std::ostream" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 45 - error: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 45 - error: using decl 'rethrow_exception' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 45 - note: remove the using

using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;

!Line: 46 - error: no header providing "std::runtime_error" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;

!Line: 46 - error: using decl 'runtime_error' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 46 - note: remove the using

using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;
using TCPPStr = TestCPP::TestCPPCommon::Strings;

!Line: 48 - error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;
using TCPPStr = TestCPP::TestCPPCommon::Strings;
namespace TestCPP {

!Line: 49 - error: no header providing "std::tuple" is directly included [misc-include-cleaner,-warnings-as-errors]

void TestSuite::setSuiteName (TestObjName&& testSuiteName) {
this->suiteName = std::move(testSuiteName);
}
unsigned TestSuite::getLastRunFailCount () const {
return this->lastRunFailCount;

!Line: 69 - error: no header providing "TestCPP::TestObjName" is directly included [misc-include-cleaner,-warnings-as-errors]

this->suiteName = std::move(testSuiteName);
}
unsigned TestSuite::getLastRunFailCount () const {
return this->lastRunFailCount;
}

!Line: 70 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

unsigned TestSuite::getLastRunFailCount () const {
return this->lastRunFailCount;
}
unsigned TestSuite::getLastRunSuccessCount() const {
return this->lastRunSuccessCount;

!Line: 73 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

unsigned TestSuite::getLastRunSuccessCount() const {
return this->lastRunSuccessCount;
}
void TestSuite::run () {
if (this->tests.size() == 0) {

!Line: 77 - error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors]

if (this->tests.size() == 0) {
clog << TCPPStr::NTR << endl;
return;
}
if (!this->firstRun) {

!Line: 82 - error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

clog << TCPPStr::NTR << endl;
return;
}
if (!this->firstRun) {
this->lastRunSucceeded = true;

!Line: 83 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

clog << endl
<< TCPPStr::START_RUN << TCPPStr::SUITE
<< TCPPStr::APOS << this->suiteName << TCPPStr::APOS
<< endl
<< endl;

!Line: 97 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

<< endl
<< endl;
for (TestCase test : this->tests) {
bool testPassed = false;
try {

!Line: 100 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

<< endl;
for (TestCase test : this->tests) {
bool testPassed = false;
try {
testPassed = test.go();

!Line: 101 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

<< endl;
}
catch (...) {
cerr << TCPPStr::UNK_EXC
<< endl;
}

!Line: 110 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

<< endl;
}
if (!testPassed) {
this->lastRunFailCount++;

!Line: 114 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

clog << endl;
if (this->testSuitePassedMessage &&
this->lastRunFailCount == 0) {
clog << TCPPStr::ALL << TCPPStr::APOS << this->suiteName
<< TCPPStr::APOS << TCPPStr::SUITE_TESTS_PASSED

!Line: 131 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

<< endl;
}
double suiteRuntimeElapsed = static_cast<double>(
this->totalRuntime)/TCPPNum::NANOS_IN_SEC;

!Line: 137 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

double suiteRuntimeElapsed = static_cast<double>(
this->totalRuntime)/TCPPNum::NANOS_IN_SEC;
clog << fixed;
clog << setprecision(0);
clog << TCPPStr::FINISHED_SUITE << TCPPStr::APOS

!Line: 140 - error: variable 'suiteRuntimeElapsed' of type 'double' can be declared 'const' [misc-const-correctness,-warnings-as-errors]

<< endl;
}
/**
* @brief Add a test to this test suite.
*

!Line: 151 - error: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl,-warnings-as-errors]

void TestSuite::addTest (TestCase&& test) {
this->tests.emplace_back(test);
}
/**
* @brief Add a test to this test suite.

!Line: 160 - error: rvalue reference parameter 'test' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]

test)
{
this->tests.emplace_back(
std::get<0>(test),
std::get<1>(test),
this->testSuitePassedMessage

!Line: 173 - error: rvalue reference parameter 'test' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]

template <class... Ts> no_destroy(Ts&&... ts) { new (data) T(std::forward<Ts>(ts)...); }
T& get() { return *reinterpret_cast<T*>(data); }
};
/**
* @brief Log a message that will only be output when debug

!Line: 110 - error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,-warnings-as-errors]

using std::cerr;
using std::clog;
using std::cout;
using std::endl;
using std::exception;
using std::fixed;

!Line: 45 - error: no header providing "std::cerr" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::clog;
using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::function;

!Line: 46 - error: no header providing "std::clog" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::cout;
using std::endl;
using std::exception;
using std::fixed;
using std::function;
using std::invalid_argument;

!Line: 47 - error: no header providing "std::cout" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::exception;
using std::fixed;
using std::function;
using std::invalid_argument;
using std::rethrow_exception;
using std::runtime_error;

!Line: 49 - error: no header providing "std::exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::fixed;
using std::function;
using std::invalid_argument;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;

!Line: 50 - error: no header providing "std::fixed" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::function;
using std::invalid_argument;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;

!Line: 51 - error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::invalid_argument;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 52 - error: no header providing "std::invalid_argument" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::invalid_argument;
using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 52 - error: using decl 'invalid_argument' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 52 - note: remove the using

using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 53 - error: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::rethrow_exception;
using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;

!Line: 53 - error: using decl 'rethrow_exception' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 53 - note: remove the using

using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;

!Line: 54 - error: no header providing "std::runtime_error" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::runtime_error;
using std::setprecision;
using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;

!Line: 54 - error: using decl 'runtime_error' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 54 - note: remove the using

using std::string;
using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;
using TCPPStr = TestCPP::TestCPPCommon::Strings;

!Line: 56 - error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;
using TCPPStr = TestCPP::TestCPPCommon::Strings;
namespace TestCPP {

!Line: 57 - error: no header providing "std::tuple" is directly included [misc-include-cleaner,-warnings-as-errors]

using std::tuple;
using TCPPNum = TestCPP::TestCPPCommon::Nums;
using TCPPStr = TestCPP::TestCPPCommon::Strings;
namespace TestCPP {

!Line: 57 - error: using decl 'tuple' is unused [misc-unused-using-decls,-warnings-as-errors]

!Line: 57 - note: remove the using

atomic_int TestCase::stdoutCaptureCasesConstructed;
atomic_int TestCase::logCaptureCasesConstructed;
atomic_int TestCase::stderrCaptureCasesConstructed;
atomic_int TestCase::stdoutCaptureCasesDestroyed;
atomic_int TestCase::logCaptureCasesDestroyed;
atomic_int TestCase::stderrCaptureCasesDestroyed;

!Line: 64 - error: no header providing "atomic_int" is directly included [misc-include-cleaner,-warnings-as-errors]

TestCase::stdoutBuffer =
no_destroy<unique_ptr<stringstream, void(*)(stringstream*)>>(
unique_ptr<stringstream, void(*)(stringstream*)>(
nullptr, [](stringstream*){}
)
);

!Line: 72 - error: initialization of 'stdoutBuffer' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

TestCase::clogBuffer =
no_destroy<unique_ptr<stringstream, void(*)(stringstream*)>>(
unique_ptr<stringstream, void(*)(stringstream*)>(
nullptr, [](stringstream*){}
)
);

!Line: 79 - error: initialization of 'clogBuffer' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

TestCase::stderrBuffer =
no_destroy<unique_ptr<stringstream, void(*)(stringstream*)>>(
unique_ptr<stringstream, void(*)(stringstream*)>(
nullptr, [](stringstream*){}
)
);

!Line: 86 - error: initialization of 'stderrBuffer' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

TestCase::stdoutOriginal =
no_destroy<unique_ptr<streambuf, void(*)(streambuf*)>>(
unique_ptr<streambuf, void(*)(streambuf*)>(
nullptr, [](streambuf*){}
)
);

!Line: 93 - error: initialization of 'stdoutOriginal' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

TestCase::clogOriginal =
no_destroy<unique_ptr<streambuf, void(*)(streambuf*)>>(
unique_ptr<streambuf, void(*)(streambuf*)>(
nullptr, [](streambuf*){}
)
);

!Line: 100 - error: initialization of 'clogOriginal' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

TestCase::stderrOriginal =
no_destroy<unique_ptr<streambuf, void(*)(streambuf*)>>(
unique_ptr<streambuf, void(*)(streambuf*)>(
nullptr, [](streambuf*){}
)
);

!Line: 107 - error: initialization of 'stderrOriginal' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp,-warnings-as-errors]

!Line: 110 - note: possibly throwing constructor declared here

this->notifyTestPassed = testPassedMessage;
this->test = std::move(testFn);
this->testName = std::move(name);
if (captureOut) {

!Line: 121 - error: 'notifyTestPassed' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->test = std::move(testFn);
this->testName = std::move(name);
if (captureOut) {
captureStdout();
}

!Line: 123 - error: 'test' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->test = std::move(testFn);
this->testName = std::move(name);
if (captureOut) {
captureStdout();
}

!Line: 123 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

this->testName = std::move(name);
if (captureOut) {
captureStdout();
}
if (captureLog) {

!Line: 124 - error: 'testName' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->testName = std::move(name);
if (captureOut) {
captureStdout();
}
if (captureLog) {

!Line: 124 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

TestCase::TestCase (const TestCase& o) {
this->outCompareOption(o.option);
this->setNotifyPassed(o.notifyTestPassed);
this->pass = o.pass;
this->lastRunTime = o.lastRunTime;

!Line: 145 - error: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

this->pass = o.pass;
this->lastRunTime = o.lastRunTime;
this->stdoutCaptured = o.stdoutCaptured;
this->clogCaptured = o.clogCaptured;
this->stderrCaptured = o.stderrCaptured;

!Line: 149 - error: 'pass' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->lastRunTime = o.lastRunTime;
this->stdoutCaptured = o.stdoutCaptured;
this->clogCaptured = o.clogCaptured;
this->stderrCaptured = o.stderrCaptured;

!Line: 150 - error: 'lastRunTime' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->stdoutCaptured = o.stdoutCaptured;
this->clogCaptured = o.clogCaptured;
this->stderrCaptured = o.stderrCaptured;
if (this->stdoutCaptured) {
captureStdout();

!Line: 152 - error: 'stdoutCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->clogCaptured = o.clogCaptured;
this->stderrCaptured = o.stderrCaptured;
if (this->stdoutCaptured) {
captureStdout();
}

!Line: 153 - error: 'clogCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->stderrCaptured = o.stderrCaptured;
if (this->stdoutCaptured) {
captureStdout();
}
if (this->clogCaptured) {

!Line: 154 - error: 'stderrCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

TestCase::TestCase (TestCase&& o) noexcept {
this->option = std::move(o.option);
this->setNotifyPassed(std::move(o.notifyTestPassed));
this->pass = std::move(o.pass);

!Line: 170 - error: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]

this->option = std::move(o.option);
this->setNotifyPassed(std::move(o.notifyTestPassed));
this->pass = std::move(o.pass);
this->lastRunTime = std::move(o.lastRunTime);

!Line: 171 - error: 'option' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]

this->option = std::move(o.option);
this->setNotifyPassed(std::move(o.notifyTestPassed));
this->pass = std::move(o.pass);
this->lastRunTime = std::move(o.lastRunTime);

!Line: 171 - error: std::move of the expression of the trivially-copyable type 'TestCaseOutCompareOptions' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]

this->option = std::move(o.option);
this->setNotifyPassed(std::move(o.notifyTestPassed));
this->pass = std::move(o.pass);
this->lastRunTime = std::move(o.lastRunTime);

!Line: 171 - error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors]

this->setNotifyPassed(std::move(o.notifyTestPassed));
this->pass = std::move(o.pass);
this->lastRunTime = std::move(o.lastRunTime);
this->stdoutCaptured = std::move(o.stdoutCaptured);

!Line: 173 - error: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg,-warnings-as-errors]


!Maximum character count per GitHub comment has been reached! Not all warnings/errors has been parsed!

eljonny added 2 commits June 3, 2025 01:43
Use find_package, as that is how FindBacktrace is intended to be used.
No need to call FindBinUtils, this CMake find module is loaded during
 CMake initialization.
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.44%. Comparing base (69a19b2) to head (d2902ae).
Report is 13 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #116   +/-   ##
=======================================
  Coverage   87.44%   87.44%           
=======================================
  Files          10       10           
  Lines         486      486           
  Branches       61       61           
=======================================
  Hits          425      425           
  Misses         52       52           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eljonny eljonny merged commit bbac97c into main Jun 3, 2025
41 of 42 checks passed
@eljonny eljonny deleted the convert-boost-stacktrace-to-git-submodule branch June 3, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert Boost::stacktrace to a git submodule and dynamic CMake dependency

1 participant